<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8"/>
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta http-equiv="pragma" content="no-cache">
    <meta http-equiv="Cache-Control" content="no-cache, must-revalidate">
    <meta http-equiv="expires" content="0">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <title>Crown 快速开发Web应用脚手架</title>
    <link rel="icon" href="assets/images/favicon.ico" type="image/x-icon"/>
    <link rel="shortcut icon" href="assets/images/favicon.ico" type="image/x-icon"/>
    <link rel="stylesheet" href="assets/libs/layui/css/layui.css" type="text/css"/>
    <link rel="stylesheet" href="assets/css/crown.css" type="text/css"/>
    <link rel="stylesheet" href="module/formSelects/formSelects-v4.css" type="text/css"/>
    <link rel="stylesheet" href="assets/css/metroStyle/metroStyle.css" type="text/css"/>
</head>

<body class="layui-layout-body">
<div class="layui-layout layui-layout-admin">
    <!-- 头部 -->
    <div class="layui-header" p-com="header"></div>

    <!-- 侧边栏 -->
    <div class="layui-side" p-com="side"></div>

    <!-- 主体部分 -->
    <div class="layui-body"></div>

    <!-- 底部 -->
    <div class="layui-footer">
        <iframe style="margin-top:10px;width: 200px;height: 28px" allowtransparency="true" frameborder="0"
                scrolling="no"
                src="//tianqi.eastday.com/plugin/widget_v1.html?sc=3&amp;z=1&amp;t=1&amp;v=0&amp;d=1&amp;bd=0&amp;k=&amp;f=&amp;q=1&amp;a=1&amp;c=54511&amp;w=317&amp;h=28&amp;align=center"></iframe>
        <span class="pull-right">Copyright © 2018 Crown All rights reserved</span>
    </div>

    <!-- 手机屏幕遮罩层 -->
    <div class="site-mobile-shade"></div>
</div>

<script type="text/javascript" src="assets/libs/jquery-3.2.1.min.js"></script>
<script type="text/javascript" src="assets/libs/q.js"></script>
<script type="text/javascript" src="assets/libs/pandyle.min.js"></script>
<script type="text/javascript" src="assets/libs/layui/layui.js"></script>
<script type="text/javascript" src="assets/libs/zTree_v3/jquery.ztree.all.min.js"></script>
<script>
    layui.config({
        //设定扩展的Layui模块的所在目录，一般用于外部模块扩展
        base: 'module/',
        //一般用于更新模块缓存，默认不开启。设为true即让浏览器不缓存。也可以设为一个固定的值，如：201610
        version: true,
        //用于开启调试模式，默认false，如果设为true，则JS模块的节点会保留在页面
        debug: true
    }).extend({
        formSelects: 'formSelects/formSelects-v4',
        iconPicker: 'iconPicker/iconPicker',
        treetable: 'treetable/treetable'
    }).use(['config', 'index', 'element', 'crown'], function () {
        var config = layui.config;
        var index = layui.index;
        var element = layui.element;
        var crown = layui.crown;
        // 检查是否登录
        if (!config.getToken() || config.getToken() == '') {
            location.replace('login.html');
            return;
        }
        // 获取当前用户信息
        index.getUser(function (user) {
            $('.layui-layout-admin .layui-header').vm(user);
            index.initLeftNav();
            element.render('nav');
            index.initRouter();
            index.bindEvent();
        });
        crown.get('/account/menus', {async: false}, function (data) {
            config.putMenus(data.result);
        });
        crown.get('/account/buttons/aliases', {async: false}, function (data) {
            config.putPermButtons(data.result);
        });
    });
</script>
</body>

</html>